package com.example.springeventlistenersample;

import org.springframework.context.ApplicationEvent;

/**
 * spring传递的事件
 * @param <T> 传递的事件数据
 */

public class SpringEvent<T> extends ApplicationEvent {


    private final T data;//这个是事件传递的真实业务字段

    public SpringEvent(Object source, T data) {
        super(source);
        this.data = data;
    }

    public T getData() {
        return data;
    }
}
